﻿.mud-picker-container {
    & + .mud-picker-color-toolbar {
        border-top-left-radius: inherit;
        border-top-right-radius: inherit;
    }

    & + .mud-picker-color-content {
        border-top-left-radius: inherit;
        border-top-right-radius: inherit;
    }
}


.mud-picker-color-toolbar {
    height: 32px;
    padding-right: 2px;
    padding-left: 2px;
}

.mud-picker-color-content {
    min-height: unset;
    position: relative;
}

.mud-picker-color-picker {
    width: 312px;
    height: 250px;
    position: relative;
    overflow: hidden;

    .mud-picker-color-overlay {
        width: 100%;
        height: 100%;

        &.mud-picker-color-overlay-white {
            background: linear-gradient(to right, white 0%, rgba(255, 255, 255, 0) 100%);
        }

        &.mud-picker-color-overlay-black {
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, black 100%);
        }
    }

    .mud-picker-color-selector {
        position: absolute;
        top: -13px;
        left: -13px;
    }
}

.mud-picker-color-controls {
    width: 312px;
    padding: 16px;
    display: flex;
    flex-direction: column;

    .mud-picker-color-controls-row {
        display: flex;
        align-items: center;

        & + .mud-picker-color-controls-row {
            margin-top: 24px;
        }

        .mud-picker-color-sliders {
            display: flex;
            flex: 1 0 auto;
            flex-direction: column;

            .mud-picker-color-slider {
                min-width: 224px;
                border-radius: var(--mud-default-borderradius);

                & > input {
                    height: 10px;
                    border-radius: var(--mud-default-borderradius);

                    @include slider-track {
                        background: initial;
                    }

                    @include slider-thumb {
                        appearance: none;
                        margin-top: -6px;
                        height: 14px;
                        width: 14px;
                        transform: none;
                        transition: none;
                        background: #f0f0f0;
                        box-shadow: rgba(0, 0, 0, 0.37) 0px 1px 4px 0px;
                    }

                    &:active {
                        @include slider-thumb {
                            box-shadow: 0 0 0 2px var(--mud-palette-action-default-hover) !important;
                        }
                    }
                }

                &.hue + .alpha {
                    margin-top: 18px;
                }

                &.hue > input {
                    background: linear-gradient( 90deg, #FF0000, #ff0 16.66%, #0f0 33.33%,#0ff 50%, #00f 66.66%, #f0f 83.33%, #FF0000);
                }

                &.alpha > input {
                    background: url() repeat;
                }
            }
        }

        .mud-picker-color-inputs {
            display: flex;
            flex: 1 1 auto;

            .mud-picker-color-inputfield {
                width: 100%;
                margin-right: 8px;
                margin-inline-end: 8px;
                margin-inline-start: unset;

                &:last-of-type {
                    margin-right: 0;
                    margin-inline-end: 0;
                    margin-inline-start: unset;
                }

                .mud-input {
                    input {
                        padding: 6px;
                        height: 1em;
                        text-align: center;
                        font-size: 14px;
                    }
                }

                .mud-input-helper-text {
                    text-align: center;
                    & div div {
                        margin:auto;
                    }
                }
            }
        }

        .mud-picker-control-switch {
            margin-left: 8px;
            margin-inline-start: 8px;
            margin-inline-end: unset;
            padding-bottom: 16px;
        }

        .mud-picker-color-collection {
            display: flex;
            min-width: 230px;
            justify-content: space-between;

            .mud-picker-color-dot {
                max-width: 38px;
            }
        }
    }
}

.mud-picker-color-dot {
    height: 38px;
    min-width: 38px;
    width: 100%;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-radius 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
    border-radius: var(--mud-default-borderradius);
    box-shadow: 0 0 6px rgba(127, 130, 134, 0.18);

    &:hover {
        cursor: pointer;
        box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);
    }

    &.mud-picker-color-dot-current {
        background: url() repeat;
    }

    .mud-picker-color-fill {
        width: 100%;
        height: 100%;
        border-radius: inherit;
    }

    & + .mud-picker-color-sliders {
        margin-left: 16px;
        margin-inline-start: 16px;
        margin-inline-end: unset;
    }

    & + .mud-picker-color-collection {
        margin-left: 10px;
        margin-inline-start: 10px;
        margin-inline-end: unset;
    }
}

.mud-picker-color-view {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 6px;
    background-color: var(--mud-palette-surface);

    .mud-picker-color-view-collection {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-evenly;

        .mud-picker-color-dot {
            max-width: 38px;
            margin: 8px;

            &.selected {
                border-radius: 50%;
                box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);
            }
        }
    }
}

.mud-picker-color-picker {
    .mud-picker-color-grid {
        display: flex;
        flex-wrap: wrap;

        .mud-picker-color-dot {
            height: 25px;
            min-width: 26px;
            max-width: 26px;
            border-radius: 0px;
            box-shadow: none;
        }
    }
}